﻿
Namespace LightSwitchApplication

    Public Class Patient

        Private Sub SummaryName_Compute(ByRef result As String)
            ' Set result to the desired field value
            result = Me.surname & ", " & If(Not Me.prefname = String.Empty, Me.prefname, Me.firstname)
        End Sub

        Private Sub Age_Compute(ByRef result As Integer)
            ' Set result to the desired field value
            result = If(Not Me.dob = Nothing, DateDiff(DateInterval.Year, CDate(Me.dob), Now), Nothing)
        End Sub
    End Class

End Namespace
